﻿@model DataAccess.Datatypes.Wishes

@{
    ViewBag.Title = "My Wish List";
    Layout = "~/Views/Shared/_SiteGoodLayout.cshtml"; 
}

<div style="width: 45%; float:left; position:relative; top: 60px; margin-left: 60px;">   
    <h2 class="blue-font-title"><img src="~/Images/rating_32.png"/> My Wish List</h2>
    @foreach (var item in Model.Goods) {
        <div class="span2">
            <a href="/@ViewBag.Name/View/@Html.DisplayFor(modelItem => item.Id)">
                <h4 class="blue-font">@Html.DisplayFor(modelItem => item.Name)</h4>
            </a>
            <img style="border: 1px solid #aeaeae;" src="@Url.Action("GetImage", "HomeSite", new { goodId = item.Id })" />
            <p>@Html.DisplayFor(modelItem => item.Likes) users like this!</p>            
        </div>
    }
    <div>
    <p class="blue-font not-transform-text">
        @Html.ActionLink("Modify My Wish List", "MyWishList/Edit", (string)ViewBag.Name)
    </p>
</div>
</div>
<div style="width: 45%; float:right; position:relative; top: 60px;">  
    <div id="map_canvas" style="width: auto; height: 250px; position:relative; display:block; background: #eee; border: 1px solid #e3e3e3;"></div>        
</div>

@section scripts {
<script type="text/javascript">
    function CrearMapa(){
        var mapOptions = {
            center: new google.maps.LatLng(@Model.Latitude.ToString().Replace(",", "."),@Model.Longitude.ToString().Replace(",", ".")),
            zoom: 10,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };

        var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

        @{<text>var mark = new google.maps.Marker({
            position: new google.maps.LatLng(@Model.Latitude.ToString().Replace(",", ".") , @Model.Longitude.ToString().Replace(",", ".")),
            map: map,
            title: 'Origin'});
        </text>}

         @foreach (var item in Model.Goods) 
          {
             <text>var mark = new google.maps.Marker({
             position: new google.maps.LatLng(@item.Latitude.ToString().Replace(",", ".") , @item.Longitude.ToString().Replace(",", ".")),
             map: map,
             title: '@item.Name' 
         });
             </text>
          }
    }

    window.onload = function () {
        CrearMapa();
    };
</script>
}